<!--
Computer Science Course 531 - Introduction to Software Engineering
Olive Insurance Client Management System (Client Database Access)
Version 1.0 (Base System)
Spring 2011

-- Source Code Details --
Page Tile: reportDetails.php
Created By: David Gonzalez, Computer Science (Undergraduate)
Documented By: Darrius Serrant, Computer Science (Undergraduate)
Purpose: Interface that provides users access the software's report generation features.
Status: Completed. All functionality has been implemented. User interface changes now pending.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Report Generator:</title>
    </head>
    <h2>Report Generator:</h2>
    <body>
        <?php
       /*
        *  PHP Documentation: Handles POST request transmissions; sends the user back to the
        *  home page if the user clicked the Back button and the "back" attribute value is present
        *  in the POST header. Otherwise, generates the page hyperlinks to the various report generation
        *  features, assuming that the user is logged in.
        */
        session_start();
        require_once('connectvars.php');
        if(isset($_POST['back'])){
            header('Location: http://localhost:8888/PHP3/mainPage.php');
        }
        if(isset($_SESSION['user_name'])){
            echo "<a href=generateRenewal.php target='_blank'>Generate Renewal Report</a> </br>";
            echo "<a href=generateList.php target='_blank'>Generate Companies List</a> </br>";
            echo "<a href=generateCensus.php target='_blank'>Generate Census</a>";
            ?>
        <form action="reportDetails.php" method ="post">
        <input type ="submit" value="Back" name ="back" />
        </form>
        <?php
       /*
        *  PHP Documentation: PHP redirection to the home page for unauthenticated users.
        */
        }else{

            echo 'You aren\'t logged in! <br>';
            header('Refresh: 2; http://localhost:8888/PHP3/signIn.php');
            echo 'You will be transfered to Sign In page...';
        }
        ?>
    </body>
</html>
